<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8" />
	<title>二叉树</title>
	<style type="text/css">
		span{
			margin-right:1em;
		}
	</style>
</head>
<body>
	<div id="R1"></div>
	<div id="R2"></div>
	<div id="R3"></div>
	<script src="../../src/Shuffle.js"></script>
	<script src="../../src/BinarySearchTree.js"></script>
	<script>
		var btree = new BinarySearchTree();
		var max = 20;
		var arr = Shuffle(max);
		for(var i= 0;i<max-1;i++) btree.insert(arr[i]);

		var elmR1 = document.getElementById('R1');
		var elmR2 = document.getElementById('R2');
		var elmR3 = document.getElementById('R3');

		btree.inorderTraveral(function(node){
			var elmSpan = document.createElement('span');
			elmSpan.textContent = node.data;
			elmR1.appendChild(elmSpan);
		});

		console.log(btree.inorderTraveral(function(){}));
	</script>
</body>
</html>